package com.ulic.customerManApplication.commonmodule.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ulic.customerManApplication.commonmodule.bo.Log;
import com.ulic.customerManApplication.commonmodule.dao.LogDao;
import com.ulic.customerManApplication.commonmodule.service.LogService;
import com.ulic.customerManApplication.pager.PagerModel;
@Component("logService")
public class LogServiceImpl implements LogService {

	private LogDao logDao;
	
	public void addLog(String ip,Date date,int type,String content) throws Exception {
		Log log = new Log();
		log.setIp("0:0:0:0:0:0:0:1".equals(ip)?"127.0.0.1":ip);
		log.setTime(date);
		log.setType(type);
		log.setContent(content);
		logDao.addLog(log);
	}
	@Override
	public PagerModel getPager(int page, int logType) throws Exception {
		return logDao.getPager(page, logType);
	}
	@Resource
	public void setLogDao(LogDao logDao) {
		this.logDao = logDao;
	}


}
